﻿@using Microsoft.Practices.Unity;
@using Vit.Web.Providers;
@using Vit.Web.Mvc.DataAnnotations;
@{
    string val = string.Empty;
    if(this.Model != null)
    {
        DataSourceAttribute attr = ViewData.ModelMetadata.AdditionalValues[DataSourceAttribute.AttributeKey] as DataSourceAttribute;
        if (attr != null)
        {
            IDataSourceProvider dsProvider = Unity.Current.Resolve<IDataSourceProvider>(string.Format("DataSource:{0}", attr.DataSourceType.Name));

            if (dsProvider != null)
            {
                val = dsProvider.GetTextByValue(null, this.Model);
            }
        }
    }
}
<span>@val</span>